# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Andreas Hauser <andy-aur@splashground.de>

pkgname=unpaper
pkgver=7.0.0
pkgrel=2
pkgdesc="post-processing tool for scanned sheets of paper"
arch=('loong64' 'x86_64')
url="https://github.com/unpaper/unpaper"
license=("GPL")
depends=('ffmpeg')
makedepends=('libxslt' 'docbook-xsl' 'meson' 'python-sphinx')
source=("$pkgname-${pkgver}.tar.gz::https://github.com/unpaper/unpaper/releases/download/unpaper-$pkgver/unpaper-$pkgver.tar.xz"
         ffmpeg5.patch)
sha256sums=('2575fbbf26c22719d1cb882b59602c9900c7f747118ac130883f63419be46a80'
            'f0d2d96ce399acb41ab8392855f857fcd0e3b1e5d869bb5753a90633c4dfb977')

build() {
  cd "$srcdir"/unpaper-$pkgver
  arch-meson . build
  meson compile -C build
}

package() {
  cd "$srcdir"/unpaper-$pkgver
  meson install -C build --destdir "$pkgdir"
  install -dm0755 "$pkgdir"/usr/share/doc/
  cp -a doc "$pkgdir"/usr/share/doc/unpaper
  install -D README.md NEWS "$pkgdir"/usr/share/doc/unpaper/
}
